package com.example.leetcode.tree;

import com.example.leetcode.tree.common.TreeNode;
import com.example.leetcode.tree.common.TreeUtils;

import java.util.Arrays;
import java.util.List;

/**
 * AC
 */
class Solution102 {
    public List<List<Integer>> levelOrder(TreeNode root) {
        return TreeUtils.levelOrverBFSToLevelList(root);
    }
}

public class leetcode102 {

    public static void main(String[] args) {

        Integer[] arrP = {3, 9, 20, null, null, 15, 7};
//        Integer[] arrP = {1};
//        Integer[] arrP = {};
        List<Integer> nodeListP = Arrays.asList(arrP);
        TreeNode root = TreeUtils.generateAtreeByBFSList(nodeListP);

        Solution102 solution102 = new Solution102();

        System.out.println("题目结果=====================");
        System.out.println(solution102.levelOrder(root));

    }
}
